home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / CIncludes / Menus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-28  |  5.3 KB  |  201 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Saturday, July 27, 1991 at 4:33 PM
  5.  Menus.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1985-1991
  10.   All rights reserved.
  11.  
  12. *** Warning: This is an alpha version of the Interfaces for Cube-E. 
  13. ***          Things may change.  Caveat Programmer.
  14.  
  15.  
  16. */
  17.  
  18.  
  19. #ifndef __MENUS__
  20. #define __MENUS__
  21.  
  22. #ifndef __QUICKDRAW__
  23. #include <Quickdraw.h>
  24. #endif
  25.  
  26.  
  27. enum {
  28.  
  29.  
  30. #define noMark '\0'        /*mark symbol for MarkItem*/
  31.  
  32. /* menu defProc messages */
  33.  
  34.  mDrawMsg = 0,
  35.  mChooseMsg = 1,
  36.  mSizeMsg = 2,
  37.  mDrawItemMsg = 4,
  38.  mCalcItemMsg = 5,
  39.  textMenuProc = 0,
  40.  hMenuCmd = 27,            /*itemCmd == 0x001B ==> hierarchical menu*/
  41.  hierMenu = -1,            /*a hierarchical menu - for InsertMenu call*/
  42.  mPopUpMsg = 3,            /*menu defProc messages - place yourself*/
  43.  mctAllItems = -98,        /*search for all Items for the given ID*/
  44.  mctLastIDIndic = -99    /*last color table entry has this in ID field*/
  45. };
  46.  
  47. struct MenuInfo {
  48.  short menuID;
  49.  short menuWidth;
  50.  short menuHeight;
  51.  Handle menuProc;
  52.  long enableFlags;
  53.  Str255 menuData;
  54. };
  55.  
  56. typedef struct MenuInfo MenuInfo;
  57. typedef MenuInfo *MenuPtr, **MenuHandle;
  58.  
  59. struct MCEntry {
  60.  short mctID;            /*menu ID.  ID = 0 is the menu bar*/
  61.  short mctItem;            /*menu Item. Item = 0 is a title*/
  62.  RGBColor mctRGB1;        /*usage depends on ID and Item*/
  63.  RGBColor mctRGB2;        /*usage depends on ID and Item*/
  64.  RGBColor mctRGB3;        /*usage depends on ID and Item*/
  65.  RGBColor mctRGB4;        /*usage depends on ID and Item*/
  66.  short mctReserved;        /*reserved for internal use*/
  67. };
  68.  
  69. typedef struct MCEntry MCEntry;
  70. typedef MCEntry *MCEntryPtr;
  71.  
  72.  
  73. typedef MCEntry MCTable[1], *MCTablePtr, **MCTableHandle;
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. struct MenuCRsrc {
  82.  short numEntries;        /*number of entries*/
  83.  MCTable mcEntryRecs;    /*ARRAY [1..numEntries] of MCEntry*/
  84. };
  85.  
  86. typedef struct MenuCRsrc MenuCRsrc;
  87. typedef MenuCRsrc *MenuCRsrcPtr, **MenuCRsrcHandle;
  88.  
  89.  
  90. #ifdef __cplusplus
  91. extern "C" {
  92. #endif
  93. pascal void InitMenus(void)
  94.  = 0xA930; 
  95. pascal MenuHandle NewMenu(short menuID,const Str255 menuTitle)
  96.  = 0xA931; 
  97. pascal MenuHandle GetMenu(short resourceID)
  98.  = 0xA9BF; 
  99. pascal void DisposeMenu(MenuHandle theMenu)
  100.  = 0xA932; 
  101. pascal void AppendMenu(MenuHandle menu,ConstStr255Param data)
  102.  = 0xA933; 
  103. pascal void AddResMenu(MenuHandle theMenu,ResType theType)
  104.  = 0xA94D; 
  105. pascal void InsertResMenu(MenuHandle theMenu,ResType theType,short afterItem)
  106.  = 0xA951; 
  107. pascal void InsertMenu(MenuHandle theMenu,short beforeID)
  108.  = 0xA935; 
  109. pascal void DrawMenuBar(void)
  110.  = 0xA937; 
  111. pascal void InvalMenuBar(void)
  112.  = 0xA81D; 
  113. pascal void DeleteMenu(short menuID)
  114.  = 0xA936; 
  115. pascal void ClearMenuBar(void)
  116.  = 0xA934; 
  117. pascal Handle GetNewMBar(short menuBarID)
  118.  = 0xA9C0; 
  119. pascal Handle GetMenuBar(void)
  120.  = 0xA93B; 
  121. pascal void SetMenuBar(Handle menuList)
  122.  = 0xA93C; 
  123. pascal void InsMenuItem(MenuHandle theMenu,ConstStr255Param itemString,
  124.  short afterItem)
  125.  = 0xA826; 
  126. pascal void DelMenuItem(MenuHandle theMenu,short item)
  127.  = 0xA952; 
  128. pascal long MenuKey(short ch)
  129.  = 0xA93E; 
  130. pascal void HiliteMenu(short menuID)
  131.  = 0xA938; 
  132. pascal void SetItem(MenuHandle theMenu,short item,ConstStr255Param itemString)
  133.  = 0xA947; 
  134. pascal void GetItem(MenuHandle theMenu,short item,Str255 itemString)
  135.  = 0xA946; 
  136. pascal void DisableItem(MenuHandle theMenu,short item)
  137.  = 0xA93A; 
  138. pascal void EnableItem(MenuHandle theMenu,short item)
  139.  = 0xA939; 
  140. pascal void CheckItem(MenuHandle theMenu,short item,Boolean checked)
  141.  = 0xA945; 
  142. pascal void SetItemMark(MenuHandle theMenu,short item,short markChar)
  143.  = 0xA944; 
  144. pascal void GetItemMark(MenuHandle theMenu,short item,short *markChar)
  145.  = 0xA943; 
  146. pascal void SetItemIcon(MenuHandle theMenu,short item,short iconIndex)
  147.  = 0xA940; 
  148. pascal void GetItemIcon(MenuHandle theMenu,short item,short *iconIndex)
  149.  = 0xA93F; 
  150. pascal void SetItemStyle(MenuHandle theMenu,short item,short chStyle)
  151.  = 0xA942; 
  152. pascal void GetItemStyle(MenuHandle theMenu,short item,Style *chStyle); 
  153. pascal void CalcMenuSize(MenuHandle theMenu)
  154.  = 0xA948; 
  155. pascal short CountMItems(MenuHandle theMenu)
  156.  = 0xA950; 
  157. pascal MenuHandle GetMHandle(short menuID)
  158.  = 0xA949; 
  159. pascal void FlashMenuBar(short menuID)
  160.  = 0xA94C; 
  161. pascal void SetMenuFlash(short count)
  162.  = 0xA94A; 
  163. pascal long MenuSelect(Point startPt)
  164.  = 0xA93D; 
  165. pascal void InitProcMenu(short resID)
  166.  = 0xA808; 
  167. pascal void GetItemCmd(MenuHandle theMenu,short item,short *cmdChar)
  168.  = 0xA84E; 
  169. pascal void SetItemCmd(MenuHandle theMenu,short item,short cmdChar)
  170.  = 0xA84F; 
  171. pascal long PopUpMenuSelect(MenuHandle menu,short top,short left,short popUpItem)
  172.  = 0xA80B; 
  173. pascal long MenuChoice(void)
  174.  = 0xAA66; 
  175. pascal void DelMCEntries(short menuID,short menuItem)
  176.  = 0xAA60; 
  177. pascal MCTableHandle GetMCInfo(void)
  178.  = 0xAA61; 
  179. pascal void SetMCInfo(MCTableHandle menuCTbl)
  180.  = 0xAA62; 
  181. pascal void DispMCInfo(MCTableHandle menuCTbl)
  182.  = 0xAA63; 
  183. pascal MCEntryPtr GetMCEntry(short menuID,short menuItem)
  184.  = 0xAA64; 
  185. pascal void SetMCEntries(short numEntries,MCTablePtr menuCEntries)
  186.  = 0xAA65; 
  187. MenuHandle newmenu(short menuID,char *menuTitle); 
  188. void getitem(MenuHandle menu,short item,char *itemString); 
  189. void appendmenu(MenuHandle menu,char *data); 
  190. void insmenuitem(MenuHandle theMenu,char *itemString,short afterItem); 
  191. long menuselect(Point *startPt); 
  192. void setitem(MenuHandle menu,short item,char *itemString); 
  193.  
  194. #define GetMBarHeight() (* (short*) 0x0BAA)
  195.  
  196. #ifdef __cplusplus
  197. }
  198. #endif
  199.  
  200. #endif
  201.